package com.xdu.spm.Librarian.Service;

import com.xdu.spm.Dao.Entity.Reader;
import com.xdu.spm.Dao.Interface.LibrarianDao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//	实现查询所有读者功能
public class ReadManagementService {
    List Readers=new ArrayList<Reader>();
    LibrarianDao librarianDao = new LibrarianDao();

    public Map<String,Object> FindAllReaders()
    {
        Map<String,Object> map = new HashMap<>();
        try{
            Readers=librarianDao.findAllReader();
            map.put("success",true);
            map.put("list",Readers);

        }catch(Exception e)
        {
            map.put("success",false);
        }

        return map;
    }
}
